﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace ebc.componentbinder.tests
{
    [TestFixture]
    public class test_InputPin
    {
        [Test]
        public void Returns_parameter_type()
        {
            var ed = new OutputPin(new SomeRelevantEvents(), typeof(SomeRelevantEvents).GetEvent("OnDouble"));
            Assert.AreEqual(typeof (double), ed.ParameterType);
        }

        [Test]
        public void Handles_naming_conventions()
        {
            var ed = new OutputPin(new SomeRelevantEvents(), typeof(SomeRelevantEvents).GetEvent("OnDouble"));
            Assert.AreEqual("Double", ed.PinName);
            ed = new OutputPin(new EventWithoutPinNamePrefix(), typeof(EventWithoutPinNamePrefix).GetEvent("XyzString"));
            Assert.AreEqual("", ed.PinName);
        }
    }
}
